package org.dtree.pv.sys.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.dtree.pv.sys.models.MyTest;
import org.dtree.pv.sys.service.MyTestService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class MyTestServiceImpl implements MyTestService {
    @Autowired
    private Dao dao;

    @Override
    public String saySth() {
        System.out.println("Hello Mother Fucker!");

        return "Hello Mother Fucker!";
    }

    @Override
    public Object test() {
        MyTest test = new MyTest();
        test.setName("111");
        test.setSex("111");
        dao.insert(test);
        List<MyTest> query = dao.query(MyTest.class, null);

        return query;
    }
}
